package edu.ahut.corejava;

import java.util.Arrays;

public class TestMethod {
    static void f(int x) {//pass by value
        x++;
    }

    static void g(int[] a) {//pass by ref
        a[0]++;
    }

    public static void main(String[] args) {
        int x = 3;
        f(x);
        System.out.println(x);

        int[] a = new int[]{1, 2, 3};
        g(a);
        System.out.println(a);//
        System.out.println(a.toString());//
        System.out.println(Arrays.toString(a));//dump array

        for (int i = 0; i < a.length; i++) {

        }
        for (int y : a) {

        }

    }
}
